/**
 * @description  : 处置申报-加工肥料
 * @descriptionDetail : 处置申报-加工肥料
 * @copyright    : 浙江烟草
 * @author       : mc
 * @create       : 2022-10-03 17:22:02
 */
<template>
  <view>
    <u-card 
      padding="10"
      margin="0px"
      :border="false"
      :show-foot="false"
    >
      <template #head>
        <u-row>
          <u-col span="12">
            <view class="card-head">
              {{ textName }}
            </view>
          </u-col>
        </u-row>
      </template>
      <template #body>
        <u-row>
          <u-col span="3" class="left-label">
            时间
          </u-col>
          <u-col span="9" class="right-label">
            {{ mxList.dtlId }}
          </u-col>
          <u-col span="3" class="left-label">
            填报人
          </u-col>
          <u-col span="9" class="right-label">
            {{ mxList.dtlCode }}
          </u-col>
        </u-row>
      </template>            
    </u-card>
    <u-card
      padding="10"
      :border="false"
      :show-foot="false"
    >
      <template #head>
        <u-row>
          <u-col span="12">
            <view class="card-head">
              物料明细
            </view>
          </u-col>
        </u-row>
      </template>
      <template #body>
        <u-table>
          <u-tr>
            <u-th>领料单号</u-th>
            <u-th>品种</u-th>
            <u-th>数量</u-th>
            <u-th>单位</u-th>
          </u-tr>
          <u-tr v-for="item in pickDtlList" :key="item.dtlId">
            <u-td>
              {{ item.dtlCode }}
            </u-td>
            <u-td>
              {{ item.dtlName }}
            </u-td>
            <u-td>{{ item.dtlWeight }}</u-td>
            <u-td>
              {{ item.weightUnit }}
            </u-td>
          </u-tr>
        </u-table>
      </template>
    </u-card>
    <u-card
      padding="10"
      :border="false"
      :show-foot="false"
    >
      <template #head>
        <u-row>
          <u-col span="12">
            <view class="card-head">
              添加剂
            </view>
          </u-col>
        </u-row>
      </template>
      <template #body>
        <u-table>
          <u-tr>
            <u-th>物品名称</u-th>
            <u-th>数量</u-th>
            <u-th>单位</u-th>
          </u-tr>
          <u-tr v-for="item in pickDtlList" :key="item.dtlId">
            <u-td>
              {{ item.dtlName }}
            </u-td>
            <u-td>{{ item.dtlWeight }}</u-td>
            <u-td>
              {{ item.weightUnit }}
            </u-td>
          </u-tr>
        </u-table>
      </template>
    </u-card>
    <u-card
      padding="10"
      :border="false"
      :show-foot="false"
    >
      <template #head>
        <u-row>
          <u-col span="12">
            <view class="card-head">
              生产投料
            </view>
          </u-col>
        </u-row>
      </template>
      <template #body>
        <u-row style="margin-top:5px;">
          <u-col span="3" class="left-label">
            监管人
          </u-col>
          <u-col span="9" class="right-label">
            {{ mxList.people }}
          </u-col>
          <u-col span="12" class="left-label">
            处置照片(视频)
          </u-col>
          <u-col span="12" class="right-label">
            <upload-images
              :url="uploadFile"
              :length="10"
              :extForm="{fiGroupCode: 'zmng-images', bizId: 'a22222'}"
              :del-url="delUrl"
              :can-add="false"
              :can-del="false"
              :renderImages="renderImages"
              ref="saveModel3"
            >
            </upload-images>
          </u-col>
          <u-col span="3" class="left-label">
            备注
          </u-col>
          <u-col span="9" class="right-label">
            {{ mxList.textarare }}
          </u-col>
        </u-row>
      </template>
    </u-card>
    <u-card
      padding="10"
      :border="false"
      :show-foot="false"
    >
      <template #head>
        <u-row>
          <u-col span="12">
            <view class="card-head">
              成品入库
            </view>
          </u-col>
        </u-row>
      </template>
      <template #body>
        <u-row style="margin-top:5px;">
          <u-col span="3" class="left-label">
            成品重量
          </u-col>
          <u-col span="9" class="right-label">
            {{ number }}
          </u-col>
          <u-col span="3" class="left-label">
            入库时间
          </u-col>
          <u-col span="9" class="right-label">
            {{ time }}
          </u-col>
        </u-row>
      </template>
    </u-card>
    <u-card 
      :show-head="false"
      padding="10"
      box-shadow="#e5e5e5 5px 10px 15px"
      border
      :show-foot="false"
    >
      <template #body>
        <u-row>
          <u-col span="3" class="left-label">
            申报人：
          </u-col>
          <u-col span="9" class="right-label">
            {{ ztList.dtlId }}
          </u-col>
          <u-col span="3" class="left-label">
            申报单位：
          </u-col>
          <u-col span="9" class="right-label">
            {{ ztList.dtlCode }}
          </u-col>
          <u-col span="3" class="left-label">
            提交时间：
          </u-col>
          <u-col span="9" class="right-label">
            {{ ztList.date1 }}
          </u-col>
          <u-col span="3" class="left-label">
            更新时间：
          </u-col>
          <u-col span="9" class="right-label">
            {{ ztList.date2 }}
          </u-col>
          <u-col span="3" class="left-label">
            流程状态：
          </u-col>
          <u-col span="9" class="right-label">
            {{ ztList.dtlName }}
          </u-col>
          <u-col span="3" class="left-label">
            当前节点：
          </u-col>
          <u-col span="9" class="right-label">
            {{ ztList.weightUnit }}
          </u-col>
          <u-col span="3.5" class="left-label">
            当前负责人：
          </u-col>
          <u-col span="8" class="right-label">
            {{ ztList.dtlWeight }}
          </u-col>
        </u-row>
      </template> 
    </u-card>
  </view>
</template>
<script>
import commonService from '@/service/internal/common.service';
import {UploadImages,} from '@/components'

export default ({
  name: "PunishDeclarFertilizer",
  components:{
    UploadImages,
  },
  props: {
    readData: {
      type: Array,
      default: () => [],
    },
  },
  data(){
    return{
      textName:'处置申报-肥料加工',
      uploadFile: commonService.uploadFile,
      delUrl: commonService.deleteFile,
      mxList:{
        dtlId :"2022-01-10",
        dtlCode: "张三",
        czfs: "销毁",
        date:'2022-10-01 10:00:00',
        weightUnit: "",
        people:'李四',
        textarare:'备注备注',
      },
      number:'李四',
      time:'2022-10-01 10:00:00',
      pickDtlList:[
        {dtlId :"11180",
          dtlCode: "2000005555444",
          dtlName: "烟丝",
          weightUnit: "kg",
          dtlWeight: "500",},
      ],
      ztList:{ // TODO 申报记录
        dtlId :"张三",
        dtlCode: "肥料厂",
        date1:'2022-10-01 10:00:00',
        date2:'2022-10-01 10:00:00',
        dtlName: "流转中",
        weightUnit: "内管处审核",
        dtlWeight: "李四",
      },
    };
  },
  methods:{
    renderImages(){
      return commonService.findFilesByBizId('a22222').then(r => {
        r.data.forEach(i => {
          i.src = `${commonService.downloadFile}?fileId=${i.gfiId}&tk=${uni.getStorageSync("tk")}`;
          i.filePath = i.src;
        });
        return r.data;
      });
    },
  },
})
</script>

<style lang="scss" scoped>
.card-head{
  color: #191F25;font-weight: bold;font-size: 32rpx;
}
.left-label{

font-size: 30rpx;
font-family: '.PingFang SC';
font-weight: 400;
margin-top: 3px;
color: #999999;
}
.right-label{
font-size: 30rpx;
font-family: '.PingFang SC';
margin-top: 3px;
font-weight: 400;
color: #333333;
}
</style>